package com.itgungnir.designpattern.iterator;

public class Test {
	public static void main(String[] args) {
		AnimalCollection animalCollection = new AnimalCollection();
		animalCollection.addAnimal("小猫");
		animalCollection.addAnimal("小狗");
		animalCollection.addAnimal("小驴");
		animalCollection.addAnimal("兔兔");
		Iterator iterator = animalCollection.iterator();
		while (iterator.hasNext()) {
			System.out.println(iterator.next());
		}
	}
}